package com.promise.paging

import android.app.Application
import android.content.Context
import java.util.concurrent.Executor

/**
 * Created by CQNNJ-003 on 2018/6/8.
 */
interface ServiceLocator {

    companion object {
        private val LOCK = Any()
        private var instance: ServiceLocator? = null
        fun instance(): ServiceLocator {
            synchronized(LOCK) {
                if (instance == null) {
                    instance = DefaultServiceLocator()
                }
                return instance!!
            }
        }
    }

    fun getRepository(): UserPostRepository

    fun getNetworkExecutor(): Executor

    fun getRedditApi(): Api

}